<template>
  <div v-if="data">
    <div v-if="data.length > 0" class="tags" :class="padding ? 'padding' : ''">
      <div class="tag-item" v-for="item in data" :key="item">
        <IconCircleCheck class="svg"></IconCircleCheck>
        <span>{{ item }}</span>
      </div>
    </div>
  </div>
  <template v-else>
    <div class="pc-skeleton">
      <div class="tags padding">
        <div class="tag-item" v-for="i in 5" :key="i">
          <Skeleton width="200px" pc></Skeleton>
        </div>
      </div>
    </div>
    <div class="mobile-skeleton">
      <div class="tags padding">
        <div class="tag-item" v-for="i in 5" :key="i">
          <Skeleton width="250px" mobile></Skeleton>
        </div>
      </div>
    </div>
  </template>
</template>

<script setup lang="ts">
type Props = {
  data?: string[];
  padding?: boolean;
};

const props = withDefaults(defineProps<Props>(), {
  padding: true,
});
</script>
<style scoped lang="less">
.skeleton-title {
  display: flex;
  justify-content: center;
}

.tags {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin: 24px 0;
  row-gap: 24px;
  column-gap: 64px;
  &.padding {
    padding: 0 500px;
  }
  .tag-item {
    display: flex;
    align-items: center;
    gap: 16px;
    .svg {
      width: 24px;
      height: 24px;
    }
    span {
      font-size: 16px;
      color: #323232;
    }
  }
}

@media screen and (max-width: 768px) {
  .tags {
    margin: 61px 0;
    &.padding {
      padding: 0;
    }
    .tag-item {
      gap: 41px;
      span {
        font-size: 62px;
      }
      .svg {
        height: 82px;
        width: 82px;
      }
    }
  }
}
</style>
